#include "winapi_timer.h"
#include "windows.h"

void HighPerformanceTimer::InitTimer(unsigned int targetLogicFps)
{
	// GetTickCount() // 15 ms resolution = BAD for accurate simulations!
	QueryPerformanceFrequency((LARGE_INTEGER *) &m_Frequency);

	m_LogicFrameTime = (m_Frequency)/(double)targetLogicFps;
}


void HighPerformanceTimer::UpdateTime0()
{
	QueryPerformanceCounter((LARGE_INTEGER *) &m_Time0);
}

void HighPerformanceTimer::UpdateTime1()
{
	QueryPerformanceCounter((LARGE_INTEGER *) &m_Time1);
}